import request from "@/utils/request.ts";
import {SkuResponseData} from "@/api/product/sku/type.ts";

enum API {
    SKU_URL = '/admin/product/list/',
//     商品上架
    SALE_URL = '/admin/product/onSale/',
//     下架
    CANCELSALE_URL = '/admin/product/cancelSale',
    DELETESKU_URL = '/admin/product/deleteSku/'
}

export const reqSkuList = (page:number, limit:number) => {
    return request.get<any, SkuResponseData>(API.SKU_URL + `${page}/${limit}`)
}

export const reqSaleSku = (skuId:number) => {
    return request.get<any, any>(API.SALE_URL+`${skuId}`)
}

export const reqCancelSale = (skuId:number) => {
    return request.get<any, any>(API.CANCELSALE_URL + `${skuId}`)
}

export const reqDeleteSku = (skuId:number) => {
    return request.delete<any, any>(API.DELETESKU_URL+skuId)
}





























